<div ng-controller="ordersCtrl">
    <table class="table table-striped table-bordered">
        <tr>
            <th>Name</th>
            <th>City</th>
            <th>Value</th>
            <th></th>
        </tr>
        <tr ng-repeat="order in orders">
            <td>{{order.name}}</td>
            <td>{{order.city}}</td>
            <td>{{calculateTotal(order)|currency}}</td>
            <td>
                <button ng-click="selectOrder(order)" class="btn btn-xs btn-primary">Details</button>
            </td>
        </tr>
    </table>
    <div ng-show="selectedOrder">
        <h3>Order Details</h3>
        <table class="table table-striped table-bordered">
            <tr>
                <th>Name</th>
                <th>Price</th>
                <th>Count</th>
            </tr>
            <tr ng-repeat="item in selectedOrder.products">
                <th>{{item.name}}</th>
                <th>{{item.price|currency}}</th>
                <th>{{item.count}}</th>
            </tr>
        </table>
    </div>
</div>